<template>
	<view class="box l2 d-jc-c d-ai-c">
		<view class="swiper2" @tap='openhospital' v-if="classifyId!==2">
			<image src="../../static/images/shoplist/lnjy@2x.png" mode="">
			</image>
			<view >
				老年就医
			</view>
		</view>
		
		<view class="swiper2" @tap='openCanteen' v-if="classifyId!==1">
			<image src="../../static/images/shoplist/lnct@2x.png" mode="">
			</image>
			<view >
				老年食堂
			</view>
		</view>
		<view class="swiper2" @tap='openShcool' v-if="classifyId!==3" >
			<image src="../../static/images/shoplist/lnct@2x.png" mode="">
			</image>
			<view >
				老年学堂
			</view>
		</view>
		<view class="swiper2" @tap='openStudy'>
			<image  src="../../static/images/shoplist/xxyp@2x.png" mode="">
			</image>
			<view >
				学习用品
			</view>
		</view>
		<view class="swiper2" @tap='onlineClass'>
			<image  src="../../static/images/shoplist/xskc@2x.png" mode="">
			</image>
			<view >
				线上课程
			</view>
		</view>
		<view class="swiper2" @tap='travelStudy'>
			<image  src="../../static/images/shoplist/yx@2x.png" mode=""></image>
			<view >
				游学
			</view>
		</view>
	
	</view>
</template>

<script>
	export default {
		name: "classify-switch",
		props: {
			classifyId: {
				type: Number,
				default: ''
			}
		
		},
		data() {
			return {
				shopName:''

			};
		},
		methods:{
		
			openCanteen(){
				uni.setStorageSync("classifyId",1)
				this.shopName = "老年餐厅"
				this.$emit('shopName',this.shopName)
				this.$emit('getShopList')
			},
			openhospital(){
				uni.setStorageSync("classifyId",2)
				this.shopName = "老年就医"
				this.$emit('shopName',this.shopName)
				this.$emit('getShopList')
			},
			openShcool(){
				uni.setStorageSync("classifyId",3)
				this.shopName = "老年学堂"
				this.$emit('shopName',this.shopName)
				this.$emit('getShopList')
			},
			openStudy(){
				uni.showToast({
					title: "暂未开放",
					duration: 1500,
					icon: "none"
				});
			},
			onlineClass(){
				uni.showToast({
					title: "暂未开放",
					duration: 1500,
					icon: "none"
				});
			},
			travelStudy(){
				uni.showToast({
					title: "暂未开放",
					duration: 1500,
					icon: "none"
				});
			},
		}
	}
</script>

<style lang="less">
	.l2 {
		width: 700rpx;
		height: 140rpx;
		background-color: #FFFFFF;
		margin: 0 auto;
		border-radius: 15rpx;
		margin-bottom: 10rpx;
		margin-top: 20rpx;
		display: flex;
		justify-content: space-around;

		.swiper2 {
			image {
				width: 56rpx;
				height: 56rpx;
			}

			view {
				color: #999999;
				font-size: 22rpx;
			}
		}

	}

	.l2 view {
		align-items: center;
		text-align: center;
	}
</style>
